<?php
namespace app\home\controller;

use app\BaseController;
use app\home\model\News;
use think\facade\View;

class Nd extends BaseController {
    public function index(){
        $news = News::find($_GET['page']);
        $prev = News::where('id', '<', $_GET['page'])->order("id desc")->find();
        $next = News::where('id', '>', $_GET['page'])->order("id")->find();
        $news_hot = News::getByOrder("date_desc");

        View::assign('news', $news);
        View::assign('prev', $prev);
        View::assign('next', $next);
        View::assign('news_hot', $news_hot);
        return View::fetch('nd:index');
    }
}